package com.ruoyi.es.common;

/**
 * api数据状态返回
 */
public class ResultInfo {
    //是否成功，返回状态码，消息提示,数据等信息
    private Boolean flag ;

    private Integer code ;

    private String message ;

    private Object data ;

    public Boolean getFlag() {
        return flag;
    }

    public void setFlag(Boolean flag) {
        this.flag = flag;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    /**
     *  增 删 改
     * @param flag  是否成功
     * @param code  状态码
     * @param message  消息体
     */
    public ResultInfo(Boolean flag, Integer code, String message) {

        this.flag = flag;
        this.code = code;
        this.message = message;
    }

    /**
     *  查询
     * @param flag 是否成功
     * @param code 状态码
     * @param message 消息体
     * @param data 数据
     */
    public ResultInfo(Boolean flag, Integer code, String message, Object data) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResultInfo() {
    }
}
